package com.dragon.client.controller.avttendance;

import com.dragon.common.model.ResponseData;
import com.dragon.logical.service.avttendance.IAttendanceChildService;
import com.dragon.repository.domain.dto.AttendanceChildDTO;
import com.dragon.repository.entity.AttendanceChild;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 考勤子表 前端控制器
 * </p>
 *
 * @author sy
 * @since 2023-07-20
 */
@RestController
@RequestMapping("attendanceChild")
@Api(tags = "考勤子表")
public class AttendanceChildController {
    @Autowired
    IAttendanceChildService service;

    @PostMapping("list")
    @ApiOperation("考勤子表list")
    public ResponseData<List<AttendanceChildDTO>> childList(Integer adminId){
        List<AttendanceChild> childList = service.childList(adminId);
        return ResponseData.success(AttendanceChildDTO.convertList(childList));
    }


}
